package com.hangzhou.xyj.ui.activity;

import com.hangzhou.xyj.R;
import com.hangzhou.xyj.ui.activity.base.BaseActivity;
import com.hangzhou.xyj.utils.appmsg.AppMsg;

import static android.text.TextUtils.isEmpty;
import static android.view.Gravity.BOTTOM;

/**
 * Created by DT-038 on 2015/12/21.
 */
public class TestActivity extends BaseActivity{
    @Override
    public void initTop() {

    }

    @Override
    public void initLayouts() {
        setContentView(R.layout.activity_test);
    }

    @Override
    public void initViews() {
        //xiao
        //fdsfdsfvdsvfs
    }

    @Override
    public void initDatas() {
        //duanfb][\
        //sdsss
        //modify 2
        //mmodify 3
        //tvgr
        //tvgr
        //tvgr
        //tvgr
    }

    @Override
    public void initListeners() {


    }

    /*AppMsg的Demo*/
//    private void showAppMsg() {
//        mMsgCount++;
//        final int styleSelected = mStyle.getSelectedItemPosition();
//        final int priority = positionToPriority(mPriority.getSelectedItemPosition());
//        final CharSequence providedMsg = mProvidedMsg.getText();
//        final CharSequence msg = isEmpty(providedMsg)
//                ? new StringBuilder().append(mStyle.getSelectedItem())
//                .append(" ").append(mPriority.getSelectedItem())
//                .append(" msg#").append(mMsgCount).toString()
//                : providedMsg;
//        final AppMsg.Style style;
//        boolean customAnimations = false;
//        AppMsg provided = null;
//        switch (styleSelected) {
//            case 0:
//                style = AppMsg.STYLE_ALERT;
//                break;
//            case 1:
//                style = AppMsg.STYLE_CONFIRM;
//                break;
//            case 3:
//                style = new AppMsg.Style(LENGTH_SHORT, R.color.custom);
//                customAnimations = true;
//                break;
//            case 4:
//                style = new AppMsg.Style(LENGTH_STICKY, R.color.sticky);
//                provided = AppMsg.makeText(this, msg, style, R.layout.sticky);
//                provided.getView()
//                        .findViewById(R.id.remove_btn)
//                        .setOnClickListener(new CancelAppMsg(provided));
//                break;
//            default:
//                style = AppMsg.STYLE_INFO;
//                break;
//        }
//        // create {@link AppMsg} with specify type
//        AppMsg appMsg = provided != null ? provided : AppMsg.makeText(this, msg, style);
//        appMsg.setPriority(priority);
//        if (mParent.isChecked()) {
//            appMsg.setParent(mAltParent);
//        } else {
//            if (mBottom.isChecked()) {
//                appMsg.setLayoutGravity(BOTTOM);
//            }
//        }
//
//        if (customAnimations) {
//            appMsg.setAnimation(android.R.anim.slide_in_left, android.R.anim.slide_out_right);
//        }
//        appMsg.show();
}
